package load.education;

import core.DispatcherPort;
import core.InPort;
import core.StdNode;
import core.TriggerPort;
import java.awt.Robot;

/**
 *
 * @author Ben
 */
public class Pause extends StdNode{
    private DispatcherPort done = new DispatcherPort();
    private InPort milliSeconds = new InPort(Integer.class);
    private TriggerPort wait = new TriggerPort() {
            @Override
            public void callInternal() {
                try{
                    Robot r = new Robot();
                    r.delay((Integer)milliSeconds.getValue());
                }catch(Exception ex){
                }
                done.callTargets();
            }
    };

    public Pause() {
        this.autoPutPorts();
    }

}